﻿@{
    ViewBag.Title = "JqueryFormAction";
}
@section HeaderContent{
    <script type="text/javascript" src="/Scripts/jquery.form.js"></script>
    <script type="text/javascript">
        function onupload() {
            $("#uploadForm").ajaxSubmit({
                type: "post",
                url: "@Url.Action("SaveFile", "Home")",
                success:function(result){
                    alert("上传成功");
                }
            })
        }
    </script>
}
<h2>
    使用jquery.form.js上传文件，都兼容</h2>
<form method="post" enctype="multipart/form-data" id="uploadForm">
<input type="file" name="file" id="file" />
<input type="hidden" name="author" value="kid" />
<input type="button" value="上传" onclick="onupload()" />
</form>
